package pkg

import (
	"encoding/json"
	"github.com/Baidu-AIP/golang-sdk/aip/censor"
)

func Baidu(upload string) bool {
	client := censor.NewClient("o835WXQSFVy7KOmsAFSaLUIC", "oldv7Ka8xgEFFJnf7ZiE7FXA7ojbWyPv")

	//视频url路径
	res := client.VideoCensor("视频名字", upload, upload, nil)
	var resdata map[string]interface{}
	json.Unmarshal([]byte(res), &resdata)

	if resdata["conclusion"] == "合规" {
		return true
	}
	return false
}
